package com.hx.pojo;

import org.springframework.beans.factory.FactoryBean;
/*
    factoryBeean的实现
 */
public class Mybean implements FactoryBean {
    //定义返回的其他类型的bean对象
    @Override
    public Object getObject() throws Exception {
        //创建对象
        Course course = new Course();
        course.setCno("101");
        course.setCname("java");
        return course;
    }

    @Override
    public Class<?> getObjectType() {
        return null;
    }

    @Override
    public boolean isSingleton() {
        return false;
    }
}
